/*
 * @Author: Superficial
 * @Date: 2021-01-09 11:24:26
 * @LastEditTime: 2021-02-23 16:25:54
 * @Description: 通过接口
 */
import { computed } from "vue";
import { useStore } from "vuex";
import { useRoute, useRouter } from "vue-router";
import { useTheme } from "./services/theme";
import { useGlobalState } from "./state";
export const useEnhandle = () => {
  const store = useStore();
  const route = useRoute();
  const router = useRouter();
  const theme = useTheme()
  const globalState = useGlobalState()
  
  const isMobile = computed(() => globalState.userAgent.isMobile)
  const isDarkTheme = computed(() => theme.theme.value === 'dark')

  return { route, router, store, theme, isDarkTheme, isMobile, globalState }
}